package 蓝桥杯算法;

import java.time.DayOfWeek;
import java.time.LocalDate;

public class day100 {
    public static void main(String[] args) {
       int total=0;
        LocalDate start=LocalDate.of(2000,1,1);
        LocalDate end=LocalDate.of(2020,10,1);
        while(!start.isAfter(end)){
            if(start.getDayOfMonth()==1||start.getDayOfWeek()== DayOfWeek.MONDAY){

                total+=2;
            }
            else{
                total+=1;
            }
            start=start.plusDays(1);
        }
        System.out.println(total);
        int sum=0;
        for(int i=1;i<=2020;i++){
            if(is(i,1018)){
                sum++;
            }
        }
        System.out.println(sum);
        int result=0;
        for(int i=1;i<=40;i++){
            if(isvaid(i)){
                result+=i;
            }
        }
        System.out.println(result);
        int s=0;
        int max=0;
        int deep=0;
        int[] arr={1,6,5,4,3,2,1};
        int start1=0;
        int end1=1;
        int n=7;
        while(end1<8){
            int aa=getresult(arr,start1,end1);
            if(aa>max){
                max=aa;
                deep++;
            }
            //否则不做变化
            start1=end1;
            end1=end1*2;
        }
        System.out.println(deep);
    }

    public static int gcd(int a,int b){
        //最小公约数
        return b==0?a:gcd(b,a%b);
   }
   public static boolean is(int n1,int n2){
        for(int i=2;i<=2020;i++){
            if((n1%i==0)&&(n2%i==0)){
                return true;
            }
        }
        return false;
   }
   public static  boolean isvaid(int n){
        while(n>0){
            int temp=n%10;
            if(temp==2||temp==0||temp==1||temp==9){
                return true;
            }
            n=n/10;
        }
        return false;
   }
   public static  int getresult(int[] arr,int start,int end){
        int result=0;
        for(int i=start;i<end;i++){
            if(i>=arr.length){
                return result;
            }
            else{
                result=arr[i]+result;
            }
        }
        return result;
   }



}
